<script setup lang="ts">
defineOptions({
  // 供应商分类修改、新增弹窗
  name: "ClassifyUpdateDialog"
})

import { FormData } from "@/interface/supplier.ts";

const dialogVisible = defineModel({ default: false })
const formData: FormData = reactive({
  level: '2323',
  code: '222',
  name: '梅州市华禧商贸有限公司',
  simpleCode: 'MZHSGA',
});

const emit = defineEmits(['confirm', 'close']);

const confirm = () => {
  emit('confirm');
  dialogVisible.value = false;
}

const close = () => {
  emit('close');
  dialogVisible.value = false;
}

</script>

<template>
  <el-dialog v-model="dialogVisible" title="分类编辑" width="800">
    <div class="wrap">
      <el-form style="max-width: 400px;margin: 0 auto" ref="formRef" :model="formData" label-width="60px" label-position="right">
        <el-form-item prop="level" label="上级">
          <el-input v-model="formData.level" placeholder="请输入" />
        </el-form-item>
        <el-form-item prop="code" label="编码">
          <div class="flex">
            <span style="margin-right: 15px;">308</span>
            <el-input v-model="formData.code" placeholder="请输入" />
          </div>
        </el-form-item>
        <el-form-item prop="name" label="名称">
          <el-input v-model="formData.name" placeholder="请输入" />
        </el-form-item>
        <el-form-item prop="password" label="简码">
          <el-input v-model="formData.simpleCode" placeholder="请输入" />
        </el-form-item>
      </el-form>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button type="primary" @click="confirm">
          确定
        </el-button>
        <el-button @click="close">取消</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<style scoped lang="scss">

</style>
